import Vue from 'vue'
import Vuex from 'vuex'
import sideBar from './sideBar'
import { $http } from '../plugins/httpReq'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        // 视频预览相关
        showVideoBox: false,
        showVideoUrl: '',
        showVideoTitle: '', // dialog标题
        // 图片预览相关
        showImgBox: false,
        showImgUrl: '',
        // 白名单限制
        whiteUserId: [60]
    },
    mutations: {
        changeShowVideoBox (state, val) {
            state.showVideoBox = true
            state.showVideoUrl = val.url
            state.showVideoTitle = val.title
        },

        changeShowImgBox (state, val) {
            state.showImgBox = val.flag
            state.showImgUrl = val.url
        },

        changeSideBar (state, payload) {
            state.sideBar.sideBarList = payload
        }
    },
    actions: {
    },
    modules: {
        sideBar
    }
})
